<?php $title= "Site Map"; ?>
<?php
include_once('header.php');
?>
  <div id="content_bg">
    <!--start site map code-->
    <h1>Site Map</h1>
    <ul>
      <?php
	$files = glob("*.php");
	$ignore_files = array( //add any file names of files you don't want to appear in the site map
		"formsubmit.php",
		"thankyou.php",
	);
	foreach($files as $f){ 
		if(in_array($f,$ignore_files))continue;
		$file_data = file_get_contents($f);
		if(preg_match('/<title>([^<]+)<\/title>/i',$file_data,$matches)){
		$page_title = $matches[1];
		}else{
		$page_title = $f;
		}
		
		?>
      <li><a href="<?=$f;?>">
        <?=$page_title;?>
        </a></li>
      <?
	}
	?>
    </ul>
    <!--end site map code-->
    <div class="clear"></div>
    <!--mades footer stick to the bottom of the design-->
  </div>
  <!--end content_bg-->
<?php
include_once('footer.php');
?>